"use strict";
module.exports = {
  name: "Rect",
  handler: function () {
    var m = this,
      y = 0 < arguments.length && void 0 !== arguments[0] ? arguments[0] : {};
    return new Promise(function (t, i) {
      var e = y.x,
        o = void 0 === e ? 0 : e,
        d = y.y,
        r = void 0 === d ? 0 : d,
        l = y.width,
        n = void 0 === l ? 0 : l,
        h = y.height,
        a = void 0 === h ? 0 : h,
        c = y.bgColor,
        s = void 0 === c ? "" : c,
        v = y.radius,
        u = void 0 === v ? 0 : v,
        x = y.lineStyle;
      u = Math.min(u, Math.min(n, a) / 2), m.setLineStyle(x), m.ctx.fillStyle = s, m.drawRectPath({
        x: o,
        y: r,
        width: n,
        height: a,
        radius: u
      }), x.color && m.ctx.stroke(), s && m.ctx.fill(), t()
    })
  }
};